import java.util.ArrayList;
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        System.out.println("请输入学生人数");
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        ArrayList<student> list = new ArrayList<>();
        for(int i = 0;i < n;i++){
            student s = new student();
            System.out.println("请输入第"+(i + 1)+"个学生的姓名");
            String name = sc.next();
            System.out.println("请输入第"+(i + 1)+"个学生的年龄");
            int age = sc.nextInt();
            s.setName(name);
            s.setAge(age);
            list.add(s);
        }
        for(int i = 0;i < list.size();i++){
            student stu = list.get(i);
            System.out.println("名字为"+stu.getName()+",年龄为"+stu.getAge());
        }
    }
}